#ifndef SIMULATION_CONTROL_DIALOG_H
#define SIMULATION_CONTROL_DIALOG_H

#include "../documents/swpreportdocument.h"
#include "../documents/swpsimulationcasedocument.h"

#include <QtGui/QDialog>

QT_BEGIN_NAMESPACE
class QLabel;
class QLineEdit;
QT_END_NAMESPACE

namespace wfnet
{
class WfNet;
}

namespace swp
{

class SimulationControlDialog : public QDialog
{
    Q_OBJECT

public:
    SimulationControlDialog(
        const QSharedPointer<SwpSimulationCaseDocument>& document,
        wfnet::WfNet* net, int repetitions, int timeout,
        QWidget* parent = 0);
    ~SimulationControlDialog();

private:
    void createLayout(int repetitions, int timeout);
    void connectSlots();

    void showInputs();
    void hideInputs();

public slots:
    void accept();
    void reject();

private slots:
    void finished(bool interrupted);
    void stop();
    void viewReport();

private:
    QSharedPointer<SwpSimulationCaseDocument> m_document;
    QSharedPointer<SwpReportDocument> m_repDocument;
    QPushButton* m_okButton;
    QPushButton* m_cancelButton;
    QPushButton* m_viewReportButton;
    QLabel* m_repsL;
    QLabel* m_toutL;
    QLabel* m_status;
    QLabel* m_error;
    QLineEdit* m_repsE;
    QLineEdit* m_toutE;
    wfnet::WfNet* m_net;
};

} // namespace swp

#endif
